package com.example.administrator.uis.view.paint

import android.content.Context
import android.graphics.*
import android.util.AttributeSet
import android.view.View

/**
 * Created by zhiweijin on 17-11-13.
 */
class Practice03SweepGradientView(context: Context?, attrs: AttributeSet?) : View(context, attrs) {

    var paint = Paint(Paint.ANTI_ALIAS_FLAG)
    var shade = SweepGradient(250f,250f,Color.BLACK,Color.WHITE)
    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        paint.shader = shade
        canvas?.drawCircle(250f, 250f, 250f, paint)
    }
}